import { Controller, Get, Request } from "@nestjs/common";
import { ApiBearerAuth, ApiTags } from "@nestjs/swagger";
import { JwtPayload } from "src/utils/interfaces/jwt.interface";
import { StatisticService } from "./statistic.service";

@Controller("statistic")
@ApiTags("数据")
@ApiBearerAuth()
export class StatisticController {
  constructor(private readonly statisticService: StatisticService) {}

  @Get("today")
  getToday(@Request() req: { user: JwtPayload }) {
    this.statisticService.findToday(req.user.company);
  }

  @Get("yesterday")
  getYesterday(@Request() req: { user: JwtPayload }) {
    this.statisticService.findYesterday(req.user.company);
  }
}
